﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using The_Quest.Entities.Abstract;
using The_Quest.Enums;

namespace The_Quest.Entities.Enemies
{
    class Ghost:Enemy
    {
        public Ghost(Game game, Point location) : base(game, location, 8)
        {
            
        }

        public override void Move(Random random)
        {
            /*The ghost is harder to defeat than the bat. But like the bat, it will only move and attack if its hit points are greater than zero.
             * It starts with eight hit points. When it moves, there’s a one in three chance that it’ll move toward the player, and a two in three chance that it’ll stand still. 
             * If it’s near the player, it attacks the player with up to three hit points of damage.*/
            if (HitPoints>0)
            {
                var action = random.Next(1, 4);
                switch (action)
                {
                    case 1:
                        Direction moveDirection = FindPlayerDirection(Game.PlayerLocation);
                        this.location=this.Move(moveDirection, Game.Boundaries);
                        break;

                    case 2:
                    case 3:
                    break;
                }
            }

            if(NearPlayer() && !Dead)
                Game.HitPlayer(3, random);
            
        }
    }
}
